home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
compuserve-file-archive
/
02 Help & Utilities
/
TXT2BA.SEQ
< prev
next >
Wrap
Text File
|
2019-04-13
|
5KB
|
111 lines
63700 rem ****************************
63702 rem * txt.to.basic *
63704 rem * for c64/vic *
63706 rem *--------------------------*
63708 rem * convert text to basic *
63710 rem * converts sequential *
63712 rem * basic listings to true *
63714 rem * commodore basic program. *
63716 rem * ------------------------ *
63718 rem * note: program should be *
63720 rem * be saved as sequential. *
63722 rem * (on tape or disk). *
63724 rem * ++++++++++++++++++++++++ *
63726 rem * loc. 186 determines dev. *
63728 rem * to load from. *
63730 rem * (ie poke 186,1 for tape) *
63732 rem * ######################## *
63734 rem * adapted from original *
63736 rem * (c) 1984 by joel rubin *
63738 rem * -- copying permitted -- *
63740 rem * ######################## *
63742 rem * modified by tony romer *
63744 rem * to do case conversion if *
63746 rem * requested. if any of the *
63748 rem * basic keywords read in *
63750 rem * upper then reply yes to *
63752 rem * request for conversion. *
63754 rem * (basic upper characters *
63756 rem * are actually lower case *
63758 rem * in the upper/lower case *
63760 rem * mode.) may/85 *
63762 rem * ------------------------ *
63764 rem * limits: lines longer *
63766 rem * than 80 chars. will be *
63768 rem * truncated. *
63770 rem * use a text editor/ word *
63772 rem * processor to remove *
63774 rem * carriage returns in the *
63776 rem * middle of a line, if any.*
63778 rem * ------------------------ *
63780 rem * this routine will delete *
63782 rem * itself. *
63784 rem * do not try to convert *
63786 rem * listings with line #'s *
63788 rem * greater than 63699!! *
63790 rem ****************************
63792 rem ---- lower memtop -----
63794 poke56,peek(56)-1:poke55,0:clr
63796 print:input"filename";file$
63798 print:print"convert to lower case? "
63800 print"(respond yes if keywords have"
63802 print" any upper characters) (y/n): ";
63804 poke 198,0
63806 get lower$:if lower$ = "" then63806
63808 print lower$:print
63810 rem ****************************
63812 rem * read ml into buff at 679 *
63814 rem ****************************
63816 for i=679 to 766: read byte:poke i,byte:checksum=checksum+byte
63818 next:if checksum <> 11394 then stop
63820 meml=peek(56):poke706,meml:poke752,meml
63822 ifpeek(65532)=34thenpoke725,198:poke763,202:poke766,196
63824 if lower$ <> "y" then poke 691,24:poke 692,234
63826 rem *****************************
63828 rem * open file on device (186) *
63830 rem *****************************
63832 dev=peek(186):poke 253,dev:if dev<>1 then open15,dev,15,"i"
63834 open2,dev,dev-1,file$
63836 rem *****************************
63838 rem * check error status if disk*
63840 rem *****************************
63842 if dev=1 then63850
63844 input#15,dstatus,err$,track,sect
63846 if dstatus <> 0 then print:print dstatus;err$;track;sect:end
63850 poke 144,0
63852 rem *****************************
63854 rem * main processing section *
63856 rem * ------------------------- *
63858 rem * create line from input. *
63860 rem * stuff type ahead buffer. *
63862 rem * print line, & run 63876 *
63864 rem * end program. type ahead *
63866 rem * buff will force read of *
63868 rem * text into basic, and will *
63870 rem * resume via the run 63876 *
63872 rem * that was printed. *
63874 rem *****************************
63876 poke 152,1:poke601,2:poke611,peek(253):poke621,peek(253)+95
63878 rem *****************************
63880 rem * done if status <> 0. *
63884 rem *****************************
63886 if status <>0 thenclose2:poke56,peek(56)+1:sys715:clr:end
63888 line$="":sys679:var=peek(45)+256*peek(46)
63890 poke var+2,peek(254):poke var+3,0:poke var+4,peek(56)
63892 if len(line$) > 80 then line$=left$(line$,80)
63894 rem *****************************
63896 rem * print line & run 63876 *
63898 rem *****************************
63900 printchr$(147):fori=0to2:print:next:printline$
63902 print"goto 63876"chr$(19)
63904 rem ***************************
63906 rem read via type ahead buff.
63908 rem ***************************
63910 fori=1to5:poke631+i,13:next:poke198,5:sys748:end
63912 data162,2,32,198,255,160,0,132,254,32,228,255
63914 data201,128,144,3,56,233,128,201,13,240,10,164,254
63916 data153,0,159,230,254,56,176,232,76,204,255
63918 data169,212,133,20,169,248,133,21,32,19,166,160,0
63920 data152,145,95,200,145,95,24,165,95,105,2,133,45,165,96,105,0,133,46,96
63922 data 166,254,189,0,159,157,0,2,202,16,247,166,254,32,202,170,76,134,164